package com.spring.cloud.module.type.common;


import com.spring.cloud.module.common.core.BaseEnum;
import org.apache.commons.lang3.StringUtils;

/**
 *  有效枚举
 */
public enum ValidType implements BaseEnum {

    VALID("有效"),

    INVALID("失效");

    private String desc;

    ValidType(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }


    public static ValidType getByCode(String code) {
        for (ValidType type : values()) {
            if (StringUtils.equals(type.name(), code)) {
                return type;
            }
        }
        return null;
    }
}
